package com.scloud.scloudextends.sigar;

import com.scloud.scloudextends.util.OperateSystemUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 基于 Oshi-core获取系统信息
 * @author ycs
 * @date 2023/8/7
 */
@Slf4j
@RestController
@RequestMapping("/oshi")
public class OshiController {

    @GetMapping("/cpu")
    public Object getCpuData() {
        Map<String, Object> memoryInfo = OperateSystemUtil.getMemoryInfo();
        return memoryInfo;

    }
}
